// 封装订单相关接口

import request from '@/utils/request';

// 获取订单详情
export const getOrderDetailAPI = (id) => {
    return request.get(`/order/orderInfo/auth/getOrderInfo/${id}`)
}

// 取消订单
export const cancelOrderAPI = (orderId) => {
    return request.get(`/order/orderInfo/auth/cancelOrder/${orderId}`)
}

// 获取订单支付二维码
export const getOrderQRCodeAPI = (orderId) => {
    return request.get(`/order/weixin/createNative/${orderId}`)
}

// 查询支付状态
export const getPayStatusAPI = (orderId) => {
    return request.get(`/order/weixin/queryPayStatus/${orderId}`)
}

// 获取订单列表
export const getOrderListAPI = (page, limit, patientId,orderStatus) => {
    return request.get(`/order/orderInfo/auth/${page}/${limit}`,{params: {
        patientId,
        orderStatus,
    }})
}

// 获取订单状态数据
export const getOrderStatusCountAPI = () => {
    return request.get(`/order/orderInfo/auth/getStatusList`)
}